package com.julis.html_analyse;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;

public class PackageHelper {
	public static String getAppVersion(Context context,String packageName){
		PackageManager pm = context.getPackageManager();

		try {
			PackageInfo info = pm.getPackageInfo(packageName, 0);
			return info.versionName;

		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
